<template>
  <view class="mine-page">
    <!-- 头像和昵称区域 -->
    <view class="user-info">
      <image src="/static/mine.png" class="avatar"></image>
      <text class="nickname">管理员</text>
    </view>

    <!-- 功能列表 -->
    <view class="function-list">
      <view class="function-item" @click="companyIntro">
        <text>公司信息</text>
      </view>
      <view class="function-item" @click="settings">
        <text>设置</text>
      </view>
     
      <view class="function-item" @click="checkUpdate">
        <text>检测更新</text>
      </view>
      <view class="function-item" @click="scanDevice">
        <text>扫描设备</text>
      </view>
	   <view class="function-item" @click="logout">
        <text>退出登录</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      // 可添加数据
    };
  },
  methods: {
    companyIntro() {
      // 公司简介逻辑
      uni.navigateTo({
      	url:'/pages/mine/company'
      })
    },
    settings() {
      // 设置逻辑
      uni.navigateTo({
      	url:'/pages/mine/setting'
      })
    },
    logout() {
      // 退出登录逻辑
      console.log("点击退出登录");
    },
    checkUpdate() {
      // 检测更新逻辑
      uni.showToast({
      	title:'当前是最新版本',
		icon:'none'
      })
    },
    scanDevice() {
      // 扫描设备逻辑
      uni.scanCode({
      	success: function (res) {
      		console.log('条码类型：' + res.scanType);
      		console.log('条码内容：' + res.result);
      	}
      });
    },
  },
};
</script>

<style lang="scss">
.mine-page {
  padding: 20rpx;
	box-sizing: border-box;
  
  background-color: #f5f5f5;
  height: 100vh;
}

.user-info {
  background-color: #fff;
  padding: 40rpx;
  display: flex;
  align-items: center;
  margin-bottom: 20rpx;
}

.avatar {
  width: 120rpx;
  height: 120rpx;
  border-radius: 50%;
  margin-right: 30rpx;
}

.nickname {
  font-size: 36rpx;
  font-weight: bold;
}

.function-list {
	
  background-color: #fff;
}

.function-item {
  padding: 30rpx 40rpx;
  border-bottom: 1rpx solid #eee;
  font-size: 32rpx;
}
</style>
